<template>
	<view class="page">
		<view class="title">充值金额</view>
		<input class="titint" v-model="money" type="number" placeholder="请输入充值金额" />
		<view class="btn" @tap="confirmTopup">充值</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				money:''
			}
		},
		methods: {
			jump(path, query) {
				this.$Router.push({
					path: path,
					query: query
				});
				// jump('/pages/points/success')
			},
			confirmTopup() {
				let that = this;
				if (this.money <= 0) {
					this.$u.toast('请选择或输入充值金额');
					return;
				}
				that.$http(
					'money.recharge', {
						recharge_money: that.money
					},
					'确认中...'
				).then(res => {
					if (res.code === 1) {
						that.money = '';
						that.$Router.push({
							path: `/pages/order/payment/method`,
							query: {
								orderId: res.data.id,
								orderType: 'recharge'
							}
						});
						// that.$Router.push({
						// 	path: `/pages/points/success`
						// });
					} else {
						that.$u.toast(res.msg);
					}
				});
			},
		}
	}
</script>

<style scoped>
	html,body{
		background: #FFFFFF !important;
	}
	uni-page-body{
		background: #FFFFFF !important;
	}
	.page{
		height: 100%;
		background: #fff !important;
		width: 100%;
		/* background: #FFFFFF !important; */
	}
.title{
	font-size: 36rpx;
	font-family: SourceHanSansCN-Medium, SourceHanSansCN;
	font-weight: 500;
	color: #111111;
	width: 654rpx;
	margin:0 auto;
	padding-top:90rpx;
}
.titint{
	width: 654rpx;
	height: 108rpx;
	background: #F8F8F8;
	border-radius: 16rpx;
	margin:0 auto;
	margin-top:32rpx;
	padding:0 32rpx;
	box-sizing: border-box;
}
.btn{
	width: 654rpx;
	height: 92rpx;
	background: #FBB03B;
	border-radius: 46rpx;
	font-size: 32rpx;
	font-family: SourceHanSansCN-Medium, SourceHanSansCN;
	font-weight: 500;
	color: #111111;
	line-height: 92rpx;
	text-align: center;
	margin:0 auto;
	margin-top:40rpx;
}
</style>
